//package com.example.config;
//
//import org.springframework.context.annotation.Configuration;
//import org.springframework.scheduling.annotation.AsyncConfigurer;
//import org.springframework.scheduling.annotation.EnableAsync;
//import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
//
//import java.util.concurrent.Executor;
//
///**
// * @program: springboot_course
// * @description:
// * @author: ChenZhiXiang
// * @create: 2019-06-11 15:54
// **/
//@Configuration
//@EnableAsync
//public class AsyncConfig implements AsyncConfigurer {
//
//    //定义线程池
//    @Override
//    public Executor getAsyncExecutor() {
//        ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
//        // 核心线程数
//        executor.setCorePoolSize(10);
//        // 线程池最大线程数
//        executor.setMaxPoolSize(30);
//        // 线程队列最大线程数
//        executor.setQueueCapacity(2000);
//        // 初始化
//        executor.initialize();
//        return executor;
//    }
//}
